﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogic.Helper;

public partial class MasterPage_Admin : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadControls();
    }

    private void LoadControls()
    {
        if (new LoginHelper().IsLoggedIn)
        {
            lnkLoginShow.Visible = false;
            lnkUserAcount.Text = new LoginHelper().LoginedUserName;
            lnkUserAcount.NavigateUrl = "~/MyAccount.aspx";
            lnkRegister.Visible = false;
        }
        else
        {
            lnkUserAcount.Visible = false;
            lnkLogout.Visible = false;
        }
    }
    protected void Logout_Click(object sender, EventArgs e)
    {
        LoginHelper.Logout();
        Response.Redirect("~/Default.aspx");
    }
}
